<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-saclable=no">
    <title>Wifi开关控制系统</title>
    <link href="__CSS__/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="__SWITCH__/css/style.css" type="text/css" rel="stylesheet"/>
    <script src="__JS__/jquery-3.2.1.min.js" type="text/javascript"></script>
    <script src="__JS__/bootstrap.js" type="text/javascript"></script>
    <script src="__JS__/jquery.cookie.js" type="text/javascript"></script>
    <script src="__JS__/jquery.base64.js" type="text/javascript"></script>
    <script src="__SWITCH__/js/main.js"></script>
</head>
<body>

    <div class="container" style="height: auto">
        <h3 align="center" style="margin-top: 120px;margin-bottom: 50px;color: white">登录</h3>
        <div class="row">
            <form id="form" action="{:U('User/loginCheck')}" method="post"></form>
            <div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1">
                <div class="input-group input-group-lg col-sm-12 col-md-12 col-xs-12">
                    <input type="text" form="form" id="username" name="username" class="form-control" placeholder="用户名">
                </div>
                <div class="input-group input-group-lg col-sm-12 col-md-12 col-xs-12 textMargin">
                    <input type="password" form="form" id="password" name="password" class="form-control" placeholder="密码">
                </div>
                <div class="input-group input-group-lg col-sm-12 col-md-12 col-xs-12 textMargin">
                    <button onclick="checkLoginInfo();" type="button" class="btn btn-default" style="width: 100%;color: white;background: rgb(6, 217, 149);">登录</button>
                </div>
            </div>
        </div>
    </div>

</body>
</html>
<script>
    function checkLoginInfo() {
        var userName = $('#username').val();
        var passWord = $('#password').val();

        if(userName == ""){
            alert("用户名不能为空");
            $('#username').focus();
            return;
        }

        if(passWord == ""){
            alert("密码不能为空");
            $('#password').focus();
            return;
        }
        $('#form').submit();
    }
</script>